(R) How to include arguments when passing a function